﻿using BlogWeb.Services;
using Microsoft.AspNetCore.Mvc;


namespace BlogWeb.Controllers
{
    [Route("[controller]/[action]")]
   // [ApiController]
    public class PostController : Controller
    {
        private PostService _postService;
        public PostController(PostService postService)
        {
            _postService = postService;        
        }


        [HttpGet]
        public IActionResult GetAllPostList()
        {
            var res = _postService.GetAllList();
            return Ok(new { data =  res, msg = "success", code = 200});
            //return (IActionResult)_postService.GetAllList();
        }
        [HttpPost]
        public IActionResult GetAllPostList111()
        {
            return (IActionResult)_postService.GetAllList();
        }

    }
}
